// pages/self/appointInformation/appointInformation.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
  doctorName:"",
  personName:"",
  personSex:"",
  appointTime:"",
  illDescribe:"",
  photoUrl:"../../images/1.png",
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    console.log(getApp().globalData.bookId)
    wx.request({
      url:  getApp().globalData.url+'successOrderInfo', // 仅为示例，并非真实的接口地址
      method: 'GET',
      data: {
          bookId:getApp().globalData.bookId
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 默认值
      },
      success(res) {
        console.log(res.data)
        that.setData({
          doctorName:res.data.doctorInfoForm.doctorName
        })
        that.setData({
          personName: res.data.patientName
        })
        that.setData({
          personSex: res.data.patientSex
        })
        that.setData({
          personAge: res.data.personAge
        })
        that.setData({
          appointTime: res.data.orderForm.bootDate +" "+ res.data.orderForm.bootTime 
        })
        that.setData({
          illDescribe: res.data.patientInfoForm.sickSketch
        })
        that.setData({
          photoUrl: res.data.patientInfoForm.sickInfo
        })
      },
      fail(res){
        wx.showToast({
          title: '网络连接失败，请重新尝试',
          icon:'none'
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})